<script>
	import Vue from 'vue';
	export default {
		onLaunch: function() {
			console.log('App Launch')
			let _this = this;
			uni.getSystemInfo({
				success: function(e) {
					Vue.prototype.statusBar = e.statusBarHeight
					console.log('<>>>>>>>>>>>>>>>>>>>>>>>>>>*************************', e.statusBarHeight)
					// #ifndef MP
					if (e.platform == 'android') {
						Vue.prototype.customBar = e.statusBarHeight + 50
					} else {
						Vue.prototype.customBar = e.statusBarHeight + 45
					}
					Vue.prototype.menu = {
						top: 20,
						height: 44
					}
					// #endif

					// #ifdef MP-WEIXIN
					Vue.prototype.$isIOS = (e.system.split(' ') || [])[0] === 'iOS'
					console.log('<>>>>>>>>>>>>>>>>>>>>>>>>>>*************************', _this.isIOS)
					let custom = wx.getMenuButtonBoundingClientRect()
					Vue.prototype.menu = wx.getMenuButtonBoundingClientRect()
					Vue.prototype.customBar = custom.bottom + custom.top - e.statusBarHeight
					// #endif

					// #ifdef MP-ALIPAY
					Vue.prototype.customBar = e.statusBarHeight + e.titleBarHeight
					// #endif
				}
			})
			let userStorage = uni.getStorageSync('xam:user');
			
			if (userStorage) {
				this.$store.dispatch('user/login', userStorage)
				this.$store.dispatch('user/updateUserInfo', null)
				uni.reLaunch({
					url: '/pages/tabbar/home/home',
				});
			} 
			// console.log("console.log(userStorage)")
			// console.log(userStorage)
			// if(userStorage.isLogin) {
				
			// }
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style lang="scss">
	@import 'uni.scss';
	@import '@/uni_modules/uview-ui/index.scss';

	// @import '@/node_modules/uview-ui/index.scss';

	// @import '@/static/iconfont/iconfont.scss';
	page,
	.main {
		width: 100%;
		height: 100%;
		background-color: #f7f7f7;
	}

	/*每个页面公共css */
	* {
		box-sizing: border-box;
	}

	.row_warp {
		display: flex;
		align-items: center;
	}

	.col_warp {
		display: flex;
		flex-direction: column;
	}

	.img_val {
		width: 100%;
		height: 100%;
	}

	/* 公共空数据 */
	.no_data {
		position: fixed;
		top: 50%;
		left: 50%;
		transform: translate(-50%, -50%);
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.no_data_img {
		width: 350rpx;
		height: 150rpx;
	}

	.nodata_txt {
		font-size: 28rpx;
		font-weight: 400;
		color: #B2B2B2;
		line-height: 54rpx;
	}

	/* 一行 文本溢出显示省略号 */
	.line1_explit {
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.line2_explit {
		display: -webkit-box;
		overflow: hidden;
		text-overflow: ellipsis;
		word-wrap: break-word;
		white-space: normal !important;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
	}

	/* 按钮去边框 */
	.button::after {
		border: none
	}

	/* 未选中背景样式 */
	uni-checkbox .uni-checkbox-input {
		// border-radius: 50%;
		width: 40rpx;
		height: 40rpx;
		/* border:none; */
		border-color: #2196F3 !important;
	}

	/* 选中背景样式 */
	uni-checkbox .uni-checkbox-input.uni-checkbox-input-checked {
		height: 40rpx;
		border-color: #323232;
		background: #2196F3;
	}

	/* 选中图标样式 */
	uni-checkbox .uni-checkbox-input.uni-checkbox-input-checked:before {
		font-size: 28rpx;
		color: #fff;
	}


	.yans {
		font-weight: bold;
		color: #4CAF50;
		padding-right: 10rpx;
	}

	/* 自定义checkbox样式 */
	.checkbox-label {
		display: block;
		margin-bottom: 5px;
	}

	/* 修改checkbox的默认样式 */
	checkbox .wx-checkbox-input {
		border-color: #2db7f5;
		/* 边框颜色 */
		background-color: #2db7f5;
		/* 勾选后的背景颜色 */
	}

	/* 修改checkbox选中后对勾的样式 */
	checkbox .wx-checkbox-input.wx-checkbox-input-checked::before {
		color: #fff;
		/* 对勾颜色 */
	}
</style>